package top.zy.service.upload.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import top.zy.service.upload.service.UploadService;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 16:21 2019/6/23
 */
@RequestMapping("upload")
@RestController
public class UploadController {

    @Autowired
    @Qualifier("uploadServiceImpl")
    private UploadService uploadService;

    @PostMapping("/image")
    public String uploadImage(@RequestParam("file") MultipartFile file){
       return uploadService.uploadImage(file);
    }
}
